There are two housings which are movably connected to each other in electronic apparatuses such as portable communication terminals. Such a type of electronic apparatus, when used, moves the two housings in a direction in which they are separated from each other. For example, Patent Document 1 discloses that in an imaging device having a speaker, sound output is controlled by detecting the opening and closing of a display panel.